package com.yyfax.pay.depository.service.inner;

import com.yyfax.pay.common.model.vo.ValidResult;
import com.yyfax.pay.depository.domain.FuiouArtificialRegister;
import com.yyfax.pay.depository.domain.FuiouUserRegister;
import com.yyfax.pay.depository.vo.ArtificialRegisterVO;
import com.yyfax.pay.depository.vo.UserRegisterVO;
import com.yyfax.pay.vo.depository.ArtificialRegisterReq;
import com.yyfax.pay.vo.depository.UserRegisterReq;

/**
 * 富友存管开户service
 *
 * @author yejc
 * @date 2017-09-02
 * @since v2.0.0
 */
public interface FuiouDepositRegisterService {

	/**
	 * 用户开户注册前的校验
	 *
	 * @param merchantCode ''
	 * @param userRegisterReq userRegisterReq ''
	 * @return ValidResult ''
	 * @author yejc
	 * @throws Exception
	 * @date 2017-09-29
	 * @since v2.0.0
	 */
	public ValidResult validateUserRegister(String merchantCode, UserRegisterReq userRegisterReq) throws Exception;

	/**
	 * 校验普通用户开户幂等性
	 * 
	 * @author buyi
	 * @date 2018-01-12 16:31:17
	 * @since v2.0.7
	 * @param merchantCode 商户号
	 * @param userId 商户用户id
	 * @param name 用户姓名
	 * @param idNo 用户证件号 明文
	 * @param cardNo 用户银行卡号 明文
	 * @param phone 手机号
	 * @return 如果ValidResult.isOk true表示信息幂等，如果返回false，表示非幂等；
	 * @throws Exception
	 */
	public ValidResult validUserIdemptent(String merchantCode, String userId, String name, String idNo, String cardNo, String phone) throws Exception;

	/**
	 * 保存普通用户开户订单信息
	 * <p>
	 * 保存订单根据主键做幂等
	 * 
	 * @author buyi
	 * @date 2018-01-15 10:42:23
	 * @since v2.0.7
	 * @param merchantCode
	 * @param userRegisterReq
	 * @return
	 * @throws Exception
	 */
	public UserRegisterVO saveUserRegister(String merchantCode, UserRegisterReq req) throws Exception;

	/**
	 * 普通用户注册
	 * 
	 * @author buyi
	 * @date 2018-01-15 11:01:06
	 * @since v2.0.7
	 * @param vo
	 * @return
	 */
	public FuiouUserRegister normalUserRegister(UserRegisterVO vo);

	/**
	 * 法人用户开户前校验注册
	 *
	 * @param merchantCode 商户号
	 * @param artificialRegisterReq 法人开户请求
	 * @return ValidResult
	 * @author yejc
	 * @date 2017-09-29
	 * @since v2.0.0
	 */
	public ValidResult validateArtificialRegister(String merchantCode, ArtificialRegisterReq artificialRegisterReq);

	/**
	 * 个人用户开户注册
	 *
	 * @param req ''
	 * @param merchantCode ''
	 * @return FuiouUserRegister
	 * @throws Throwable ''
	 * @author yejc
	 * @date 2017-09-20
	 * @since v2.0.0
	 * @deprecated 解耦开户逻辑，使用新接口{@linkplain FuiouDepositRegisterService#normalUserRegister(UserRegisterVO)} edit by buyi since 2.0.7
	 */
	public FuiouUserRegister normalUserRegister(UserRegisterReq req, String merchantCode) throws Throwable;

	/**
	 * 个人用户开户信息查询
	 *
	 * @param merchantCode 商户号
	 * @param userRegisterReq 请求参数
	 * @return FuiouUserRegister
	 * @author yejc
	 * @date 2017-09-20
	 * @since v2.0.0
	 */
	public FuiouUserRegister searchFuiouUserRegister(String merchantCode, UserRegisterReq userRegisterReq);

	/**
	 * 法人用户开户注册
	 *
	 * @param req ''
	 * @param merchantCode ''
	 * @return FuiouArtificialRegister
	 * @throws Throwable 加密异常
	 * @author yejc
	 * @date 2017-09-20
	 * @since v2.0.0
	 */
	public FuiouArtificialRegister artificialUserRegister(ArtificialRegisterReq req, String merchantCode) throws Throwable;

	/**
	 * 法人用户开户注册
	 *
	 * @param merchantCode 商户号
	 * @param artificialRegisterReq 请求参数
	 * @return FuiouArtificialRegister
	 * @author liangqm
	 * @date 2017-09-20
	 * @since v2.0.0
	 */
	public FuiouArtificialRegister searchFuiouArtificialRegister(String merchantCode, ArtificialRegisterReq artificialRegisterReq);

	/**
	 * 校验法人开户幂等性
	 * 
	 * @author buyi
	 * @date 2018-01-15 14:05:00
	 * @since v2.0.7
	 * @param merchantCode 商户主键
	 * @param userId 用户id
	 * @param enterpriseName 企业名称
	 * @param bankCardNo 银行卡号
	 * @return
	 * @throws Exception
	 */

	/**
	 * 校验法人开户幂等性
	 * 
	 * @author buyi
	 * @date 2018-01-16 16:54:51
	 * @since v2.0.4
	 *        * @param merchantCode 商户主键
	 * @param userId 用户id
	 * @param enterpriseName 企业名称
	 * @param bankCardNo 银行卡号
	 * @param artificialName 法人姓名
	 * @param idNo 证件号码
	 * @param phone 手机号
	 * @return
	 * @throws Exception
	 */
	public ValidResult validArtificialIdemptent(String merchantCode, String userId, String artificialName, String idNo, String phone,
			String enterpriseName, String bankCardNo) throws Exception;

	/**
	 * 保存企业开户订单信息
	 * 
	 * @author buyi
	 * @date 2018-01-15 14:35:19
	 * @since v2.0.7
	 * @param merchantCode
	 * @param artificialRegisterReq
	 * @return
	 * @throws Exception
	 */
	public ArtificialRegisterVO saveArtificialRegister(String merchantCode, ArtificialRegisterReq artificialRegisterReq) throws Exception;

	/**
	 * 法人开户
	 * 
	 * @author buyi
	 * @date 2018-01-15 14:42:25
	 * @since v2.0.4
	 * @param vo
	 * @return
	 */
	public FuiouArtificialRegister artificialUserRegister(ArtificialRegisterVO vo);

}
